/**
 * 素材请求相关的接口
 */
import request from '@/utils/request'

/**
 * 上传图片素材
 */
export const uploadImage = data => {
    return request({
        method: 'POST',
        url: '/mp/v1_0/user/images',
        data: data
    })
}

/**
 * 获取图片素材
 */
export const getImages = params => {
    return request({
        method: 'GET',
        url: '/mp/v1_0/user/images',
        params: params
    })
}

/**
 收藏图片素材
 */
export const collectImages = (imageId, isStatus) => {
    return request({
        method: 'PUT',
        url: `/mp/v1_0/user/images/${imageId}`,
        data: {
            collect: isStatus
        }
    })
}

/**
 删除图片素材
 */
export const collectImagesDelete = (imageId) => {
    return request({
        method: 'DELETE',
        url: `/mp/v1_0/user/images/${imageId}`
    })
}